<template>
	<view class="content">
		<view class="LogoBox">
			<view class="Logo">
				<u--image class="img" :showLoading="true" src="../../static/image/Logo/Logo.png" width="120rpx"
					height="120rpx" :radius="12"></u--image>

				<view class="text" style="letter-spacing: 6px;">
					<!-- <text style="color: #e83333;">智能</text> -->
					<text style="color: #51d0d0;">汇创云</text>
					平台
				</view>
			</view>
		</view>

		<view class="FormBox">
			<uni-forms ref="baseForm" :modelValue="formData" label-position="left" class="formDataBox">

				<uni-forms-item name="Business_Code" style="margin-top: 50px;">
					<view style="display: flex;align-items: center;">
						<uni-icons fontFamily="CustomFontPlatform" color="#333"
							:size="20">{{$utils.toUniCode('&#xe75f;')}}</uni-icons>
						<uni-easyinput type="text" v-model="formData.Business_Code" trim="all" @blur="GetBusiness"
							:clearable="false" placeholder="请输入企业代号"></uni-easyinput>
					</view>
				</uni-forms-item>

				<uni-forms-item name="Business">
					<view style="display: flex;align-items: center;">
						<uni-icons fontFamily="CustomFontPlatform" color="#333"
							:size="20">{{$utils.toUniCode('&#xe64b;')}}</uni-icons>
						<uni-data-select v-model="formData.Business" :localdata="BusinessList" :clear="false"
							:formatJob="{text:'AccountName',value:'AccountID'}" @change="SelectBusiness"
							placeholder="请选择账套"></uni-data-select>
					</view>
				</uni-forms-item>

				<uni-forms-item name="UserAccount">
					<view style="display: flex;align-items: center;">
						<uni-icons fontFamily="CustomFontPlatform" color="#333"
							:size="20">{{$utils.toUniCode('&#xe649;')}}</uni-icons>

						<uni-easyinput type="text" v-model="formData.UserAccount" trim="all" :clearable="false"
							placeholder="请输入账号"></uni-easyinput>
					</view>
				</uni-forms-item>

				<uni-forms-item name="UserPwd">
					<view style="display: flex;align-items: center;">
						<uni-icons fontFamily="CustomFontPlatform" color="#333"
							:size="20">{{$utils.toUniCode('&#xe60c;')}}</uni-icons>
						<uni-easyinput type="password" v-model="formData.UserPwd" trim="all" :clearable="false"
							style="letter-spacing: 4px;" placeholder="请输入密码"></uni-easyinput>
					</view>
				</uni-forms-item>

				<uni-forms-item>
					<view class="x-bc">
						<view class="x-f">
							<checkbox-group @change="checkboxChange">
								<checkbox class="CheckBox" :checked="Remember" color="#fff"
									activeBackgroundColor="#51d0d0" activeBorderColor="#51d0d0">
									<view style="margin-left: 6px;">
										记住密码
									</view>
								</checkbox>
							</checkbox-group>

							<view @click="openWebInBrowser(1)" style="color: #51d0d0;margin-left: 10px;">用户协议</view>
							<view @click="openWebInBrowser(2)" style="color: #51d0d0;margin-left: 10px;">隐私政策</view>
						</view>


						<view class="" style="padding-right: 8rpx;color: #999;font-weight: 600;"
							@click="togetherBtn('enroll')">
							<text>注册</text>
						</view>
					</view>
				</uni-forms-item>

			</uni-forms>
		</view>

		<view class="BtnBox">

			<button class="LoginBtn" type="primary" :loading="isLoading" :disabled="isLoading" @click="LoginApp">
				<text class="Text">{{isLoading ? '正在登录...' :'登录'}}</text>
			</button>
		</view>


		<view class="BottomText">
			<text>—— ©汇智云创 技术支持 ——</text>

		</view>


		<m-loading :text="loadingText" v-model="showMLoading" :showClose="false"
			maskBackgroundColor="rgba(0,0,0,0.3)"></m-loading>
	</view>
</template>

<script>
	import UseSqliteFunByMsg from '@/pages/Message/common/sqlite-msg.js';

	import {
		getDevicesInfo
	} from "@/uni_modules/mc-device-id";

	export default {
		data() {
			return {
				isLoggingIn: false,
				showMLoading: false,
				loadingText: "正在渲染",
				datas: [50, 20],
				isLoading: false, // 登录加载状态
				lastBusinessCode: "", // 记录上一次企业代号
				formData: {
					Business_Code: '', // 企业代号
					Business: '', // 账套
					UserAccount: '', // 账号
					UserPwd: '', // 密码
				},
				BusinessList: [], // 账套列表
				Remember: true, // 是否记住密码

				Timer: null,
				rules: { // 自定义校验
					Business_Code: {
						rules: [{
							required: true,
							errorMessage: ' '
						}]
					},
					Business: {
						rules: [{
							required: true,
							errorMessage: ' '
						}]
					},
					UserAccount: {
						rules: [{
							required: true,
							errorMessage: ' ',
						}]
					},
					UserPwd: {
						rules: [{
							required: true,
							errorMessage: ' ',
						}]
					}
				},

				listenFun: null,
				InterTime: null,
			}
		},
		onShow() {
			var that = this;
			// 强制横屏
			plus.screen.lockOrientation('portrait-primary');

			uni.hideToast();

			setTimeout(() => {
				that.$store.commit('ChangeAndSetStateData', {
					Name1: 'systemConfig.msgConfig.msgBtnIsHide',
					data: true,
				});
			}, 0);
		},
		async onLoad() {
			var that = this;

			uni.setStorageSync('Allow_Restart', '1')

			// 每次退出登录时，需要清除modul数据
			if (this.$utils.isEmpty(uni.getStorageSync('Automatic_Login'))) {

				uni.removeStorageSync('ActiveModule');
				uni.removeStorageSync('ModuleInfo_All');
				uni.removeStorageSync('Module_Tabbar');

				that.$store.commit('ChangeAndSetStateData', {
					Name1: 'appConfigInfo.ActiveModule',
					data: null,
				})

				that.$store.commit('ChangeAndSetStateData', {
					Name1: 'appConfigInfo.ModuleInfo_All',
					data: [],
				});

				// 模块数据持久化 
				that.$store.commit('ChangeAndSetStateData', {
					Name1: 'appConfigInfo.Module_Tabbar',
					data: [],
				});
			}


			await this.getDeviceInfo();
			if (!that.$utils.isEmpty(that.$store.state.UserInfo)) {
				const {
					Business_Code,
					Business,
					UserAccount,
					Remember,
					UserPwd
				} = this.$store.state.UserInfo || {};
				this.formData = {
					...this.formData,
					Business_Code,
					Business,
					UserAccount
				};

				await that.GetBusiness({
					target: {
						value: Business_Code
					}
				});



				// 记住密码
				if (Remember) {
					that.formData.UserPwd = UserPwd;
					that.Remember = true;

					if (uni.getStorageSync('Automatic_Login')) {
						await that.checkNetworkAndSetup();
					}
				} else {
					that.formData.UserPwd = '';
					that.Remember = false;
				}
			}


		},
		onReady() {
			// 需要在onReady中设置规则
			this.$refs.baseForm.setRules(this.rules);
		},
		mounted() {
			let that = this;
			uni.getSystemInfo({
				success: function(res) {
					let safeArea = res.safeAreaInsets;
					uni.setStorageSync('safeAreaBottom', JSON.stringify(safeArea.bottom))
				}
			});


			this.$onQueueEvent('queueEmpty', () => {
				// 当所有事件加载完成后：
				// 开放按钮点击权限
				// console.log('login页面页面所有请求完成');
				that.showMLoading = false;
			});
			// 监听请求失败
			this.$onQueueEvent('requestFail', (ret) => {
				// 取消登录按钮加载状态
				that.isLoading = false;
				that.showMLoading = false;

			});
		},
		onUnload() {
			this.stopInterval(); // 停止定时器  

			this.removeNetworkListener();
			// if (this.listenFun !== null) {
			// 	uni.offNetworkStatusChange(this.listenFun); // 移除网络状态变化监听器  
			// 	this.listenFun = null; // 防止内存泄漏  
			// }
		},
		methods: {
			getDevicesInfoBySys() {
				const promise = new Promise((resolve, reject) => {

					let os = plus.os.name;

					if (os == 'Android') {
						plus.device.getOAID({
							success: function(e) {
								resolve(e.oaid)
							},
							fail: function(e) {
								console.log('getOAID failed: ' + JSON.stringify(e));
							}
						});
					} else if (os == 'iOS') {
						plus.device.getInfo({
							success: function(e) {
								console.log(e);
								resolve(e.uuid)
							},
							fail: function(e) {
								console.log('getDeviceInfo failed: ' + JSON.stringify(e));
							}
						})
					};

				});
				return promise;
			},
			async getDeviceInfo() { // 获取设备信息
				let that = this;
				console.log(uni.getSystemInfoSync());
				console.log(getDevicesInfo().DEVICEID);

				let sysDeviceInfo = this.$utils.deepClone(uni.getSystemInfoSync())


				Object.assign(sysDeviceInfo, {
					deviceId: getDevicesInfo().DEVICEID
				});

				that.$store.commit('ChangeAndSetStateData', {
					Name1: 'systemConfig.sysDeviceInfo',
					data: sysDeviceInfo,
					StorageName: 'sysDeviceInfo',
					StorageData: JSON.stringify(sysDeviceInfo),
				})
				this.$request('getScanDeviceInfo', {
					DeviceModel: sysDeviceInfo.deviceModel
				}, function(ret) {
					console.log(ret);
					if (ret.status == 200) {
						Object.assign(sysDeviceInfo, ret.data.ds[0]);
						that.$store.commit('ChangeAndSetStateData', {
							Name1: 'systemConfig.sysDeviceInfo',
							data: sysDeviceInfo,
							StorageName: 'sysDeviceInfo',
							StorageData: JSON.stringify(sysDeviceInfo),
						});
					}

				}, function(err) {}, 'http://' + that.Request.LoginIP() + '/Frame/SqlData', 1);

			},
			togetherBtn() { // 注册
				uni.navigateTo({
					url: '/pages/login/enrollPage',
					// animationType: 'fade-in',
					// animationDuration: 50
				});
			},
			openWebInBrowser(id) { // 打开外链
				// #ifdef APP-PLUS  


				switch (id) {
					case 1: // 用户协议
						plus.runtime.openWeb('http://mes.hzyc.org.cn:20050/download/html/汇创云平台用户协议.html');
						// plus.runtime.openURL('http://mes.hzyc.org.cn:20050/download/html/汇创云平台用户协议.html');
						break;
					case 2: // 隐私政策
						plus.runtime.openWeb('http://mes.hzyc.org.cn:20050/download/html/汇创云平台隐私政策.html');
						// plus.runtime.openURL('http://mes.hzyc.org.cn:20050/download/html/汇创云平台隐私政策.html');
						break;
					default:
						break;
				}
				// #endif  
			},
			// 自动登录逻辑（增加锁防止重复登录）
			async attemptAutoLogin() {
				if (this.isLoggingIn || this.$utils.isEmpty(this.formData.Business)) return;

				this.isLoggingIn = true;
				try {
					await this.LoginApp(); // 如果是同步函数可移除 await
					this.stopInterval();
				} catch (err) {
					console.warn("自动登录失败:", err);
				} finally {
					this.isLoggingIn = false;
				}
			},
			async checkNetworkAndSetup() {
				const that = this;
				try {
					const res = await uni.getNetworkType();
					console.log(res);
					if (res.networkType !== 'none') {
						// 已联网，立即启动定时器
						that.startInterval();
					} else {
						// 未联网，注册监听
						that.registerNetworkListener();
					}
				} catch (err) {
					console.error('获取网络类型失败:', err);
				}
			},
			// 注册网络监听器（优化版）
			registerNetworkListener() {
				const that = this;

				if (that.listenFun !== null) return; // 已注册则不重复监听

				that.listenFun = function(networkRes) {
					if (networkRes.isConnected) {
						that.startInterval();
						that.removeNetworkListener(); // 一旦触发就移除
					}
				};

				uni.onNetworkStatusChange(that.listenFun);
			},
			// 正确解绑网络监听器
			removeNetworkListener() {
				if (this.listenFun) {
					uni.offNetworkStatusChange(this.listenFun); // 正确解绑
					this.listenFun = null;
				}
			},
			// 启动定时器登录（增加登录锁）
			startInterval() {
				if (this.InterTime !== null) return;

				this.InterTime = setInterval(() => {
					this.attemptAutoLogin();
				}, 500);
			},
			// 停止定时器
			stopInterval() {
				if (this.InterTime !== null) {
					clearInterval(this.InterTime);
					this.InterTime = null;
				}
			},



			isAllZero(str) { // 判断字符串是否都是 0，或者 ''
				// return /^0*$/.test(str.trim());
				return /^(0*|null)?$/.test((str || '').trim());
			},
			GetBusiness(ret) {
				let that = this;
				const value = ret.target.value;
				// if (this.lastBusinessCode === value) return;
				// this.lastBusinessCode = value;

				// 快速检查全零或空值
				if (!value || /^0+$/.test(value)) {
					this.formData.Business = '';
					this.BusinessList = [];
					return;
				};

				// 缓存登录IP避免重复计算
				const loginIP = this.Request.LoginIP();

				this.$request('AP_GetAccountByEnterNo', {
					EnterNo: value
				}, (res) => {
					if (res?.status !== 200 || !res.data?.ds?.length) {
						that.formData.Business = '';
						that.BusinessList = [];
						return;
					}
					console.log(res);

					const ds = res.data.ds
					// .map(item => ({
					// 	...item,
					// 	text: item.AccountName,
					// 	value: item.AccountID
					// }));
					that.BusinessList = ds;

					// 快速查找目标项（O(n)操作）
					let targetItem = ds[0]; // 默认第一项
					const currentBusiness = that.formData.Business;

					if (currentBusiness) {
						// 优先匹配当前选择的企业
						for (let i = 0; i < ds.length; i++) {
							if (ds[i].AccountID === currentBusiness) {
								targetItem = ds[i];
								break;
							}
						}
					}

					// 更新业务数据
					that.formData.Business = targetItem.AccountID;

					// 更新服务IP
					const serviceIP = targetItem.ServiceIP;
					that.Request.serverIP(serviceIP);
					that.GetHttp(serviceIP);
				}, () => {
					that.formData.Business = '';
					that.BusinessList = [];
				}, `http://${loginIP}/Frame/SqlData`, 1);
			},
			GetHttp(IP) { // 判断传入的IP地址，知道协议类型 :443 - 标准的 https 协议
				var that = this;
				let TheIP = 'http://'
				let TheIndex = IP.indexOf(':443');
				if (TheIndex != -1) {
					TheIP = 'https://'
				};
				that.Request.IPAgreement(TheIP)

			},
			SelectBusiness(data) { // 账套内容改变时 
				var that = this
				let FilterData = that.BusinessList.filter(item => {
					return item.AccountID == data
				});
				that.Request.serverIP(FilterData[0].ServiceIP);

				that.GetHttp(FilterData[0].ServiceIP);
			},
			checkboxChange(data) { // 切换是否记住密码
				this.Remember = !!data.target.value.length;
			},
			GetSelectFCJType() { // 查询公司报工类型
				let that = this;
				try {
					that.$request('SelectFCJType', {}, function(ret) {
						// console.log(ret.data.ds[0]['FCJType'])
						that.FCJType = ret.data.ds[0]['FCJType'];
						that.$store.commit('ChangeAndSetStateData', {
							Name1: 'st_ticket.FCJType',
							data: ret.data.ds[0]['FCJType'],
							StorageName: 'FCJType',
							StorageData: ret.data.ds[0]['FCJType'],
						})
					})

				} catch (e) {
					//TODO handle the exception
				}
			},
			LoginApp() { // 登录
				var that = this;
				that.showMLoading = true;
				that.loadingText = "正在校验";

				// 通过ref拿到校验结果
				this.$refs['baseForm'].validate().then(res => {
					// console.log('success', res);
					that.isLoading = true;
					let obj = {
						P_Name: that.formData.UserAccount,
						P_Password: that.formData.UserPwd,
						// cmd: 'applogin'
					}
					that.$request('applogin', obj, function(res, err) {
							if (res.data.ds[0].status == 200) {

								let UserInfo = res.data.ds[0];
								UserInfo.Business_Code = that.formData.Business_Code;
								UserInfo.Business = that.formData.Business;
								UserInfo.UserAccount = that.formData.UserAccount;
								UserInfo.UserPwd = that.formData.UserPwd;

								// 查询公司报工类型-用于区分报工类型
								that.GetSelectFCJType();

								// 是否记住密码
								if (that.Remember) {
									UserInfo.Remember = that.Remember;
								}

								// if (that.$store.state.UserInfo && that.$store.state.UserInfo.HeadshotImg) {
								// 	UserInfo.HeadshotImg = that.$store.state.UserInfo.HeadshotImg;
								// } else {
								// 	// 没有做头像上传，先默认是空的
								// 	UserInfo.HeadshotImg = '';
								// }

								// 存储登录用户信息，记缓存：省去部分js脚本引入vuex
								that.$store.commit('ChangeAndSetStateData', {
									Name1: 'UserInfo',
									data: UserInfo,
									StorageName: 'UserInfo',
									StorageData: JSON.stringify(UserInfo),
								})
								setTimeout(() => {

									// that.$utils.msg(res.data.ds[0].msg);
									// uni.showToast({
									// 	title: res.data.ds[0].msg
									// })
									that.loadingText = "正在加载登录信息";

									// that.isLoading = false;

									// 开启自动登录
									uni.setStorageSync('Automatic_Login', true)

									// 查看当前登录账套授权信息
									that.searchApply()

									// 没授权接口的时候，用这个卡BUG，可以登，需要先登授权过的账套
									// uni.switchTab({
									// 	url: "/pages/index/index"
									// })
								}, 500)
							} else {
								that.$utils.msg(res.data.ds[0].msg, 2000);
								that.isLoading = false;


							}

							setTimeout(() => {
								uni.hideToast();
							}, 2000);
						},
						function(err) {
							setTimeout(() => {

								uni.showToast({
									title: '请求失败 请检查后重试',
									icon: "none",
									duration: 2000
								})
								that.isLoading = false
							}, 1000)
						}, that.Request.IPAgreement() + that.Request.serverIP() + '/Frame/ST1_SY/Handler.aspx',
						2)


				}).catch(err => {
					that.loadingText = "校验失败，请完善信息";
					console.log('err', err);
					that.isLoading = false;
					setTimeout(() => {
						that.showMLoading = false;
					}, 2000);
					// uni.showToast({
					// 	title: "请完善信息",
					// 	icon: "none",
					// 	duration: 2000
					// })


				})
			},
			async searchApply() { // 产看本机是否授权
				var that = this;

				// 判断原有通过uni的api获取的id是否在授权表，如果存在，则进行替换
				let sql = `UPDATE dbo.Ba_Licence
					SET MachineNo = @newDeviceID
					WHERE MachineNo = @oldDeviceID;
				`;

				that.Request.requestByUrl("/SQLData/QuerySql", {
					sql: sql,
					oldDeviceID: uni.getSystemInfoSync().deviceId,
					newDeviceID: that.$store.state.systemConfig.sysDeviceInfo.deviceId,
				})

				let obj = {
					machineId: that.$store.state.systemConfig.sysDeviceInfo.deviceId,
					// machineId: getDevicesInfo().ANDROID_ID,
				}
				that.loadingText = "正在查看授权信息";
				that.$request('searchapply', obj, function(res) {
					if (res.status == 200) {

						that.$store.commit('ChangeAndSetStateData', {
							Name1: 'systemConfig.isLogin',
							data: true,
						})

						// 提取公共状态更新方法
						const updateHasMsg = (hasMsg) => {
							that.$store.commit('ChangeAndSetStateData', {
								Name1: 'systemConfig.msgConfig.hasMsg',
								data: hasMsg
							});
						};
						that.isLoading = false;
						if (res.data.ds.length) {

							let Authorization_Info = res.data.ds[0];
							Authorization_Info['Authorization'] = true;
							// 已授权
							that.$store.commit('ChangeAndSetStateData', {
								Name1: 'appConfigInfo.Authorization_Info',
								data: Authorization_Info,
								StorageName: 'Authorization_Info',
								StorageData: JSON.stringify(Authorization_Info),
							});

							uni.$emit("updateApp", {
								from: 'login'
							})

							that.$store.commit('ChangeAndSetStateData', {
								Name1: 'systemConfig.msgConfig.msgBtnIsHide',
								data: false,
							});
							// 初始化消息数据库
							that.loadingText = "设备已授权，准备跳转";
							let msgName = 'msg_' + that.$store.getters.UserInfo.Business + '_' + that.$store
								.getters.UserInfo.UserID;
							UseSqliteFunByMsg.initSQLite(msgName, (ret => {
								if (ret.length) {


									const fetchNewMessages = () => {
										that.$store.commit(
											'ChangeAndSetStateData', {
												Name1: 'systemConfig.msgConfig.msgNum',
												data: 0
											})

										try {
											let param = {
												UserID: that.$store.getters.UserInfo
													.UserID,
												FBDate: that.$utils.dateFormat(new Date(
													ret[0]
													.lastData), 'Y-MM-dd hh:mm:ss')
											}
											that.$request(
												'GetSYSMessageListByLastData', param,
												(msgRet) => {
													let messageCount = 0;
													if (msgRet.status === 200 && msgRet
														.data.ds
														?.length) {
														messageCount = msgRet.data.ds[0]
															.MessageNum || 0;
													}
													let contentLength = 0;
													let contentData = JSON.parse(ret[0]
														.content);
													if (!that.$utils.isEmpty(
															contentData)) {
														contentLength = contentData.length;
													}
													messageCount += contentLength;
													updateHasMsg(messageCount > 0);
													that.$store.commit(
														'ChangeAndSetStateData', {
															Name1: 'systemConfig.msgConfig.msgNum',
															data: messageCount
														})

													uni.redirectTo({
														url: "/pages/index/index" +
															'?index=' + 0,
														success() {
															that.showMLoading =
																false;
														}
													});
												},
												(err) => {
													console.error('获取新消息失败:', err);
													updateHasMsg(false);

													uni.redirectTo({
														url: "/pages/index/index" +
															'?index=' + 0,
														success() {
															that.showMLoading =
																false;
														}
													});
												}
											);

										} catch (error) {
											updateHasMsg(false);
											that.$store.commit(
												'ChangeAndSetStateData', {
													Name1: 'systemConfig.msgConfig.msgNum',
													data: 0
												})
											uni.redirectTo({
												url: "/pages/index/index" + '?index=' +
													0
											});
										}
									};

									fetchNewMessages();

								} else {
									updateHasMsg(false);
									that.$store.commit(
										'ChangeAndSetStateData', {
											Name1: 'systemConfig.msgConfig.msgNum',
											data: 0
										})
									uni.redirectTo({
										url: "/pages/index/index" + '?index=' + 0
									});
								}
							}));



						} else {

							that.loadingText = "设备未授权，准备前往授权";
							uni.removeStorageSync('Authorization_Info');
							that.$store.commit('ChangeAndSetStateData', {
								Name1: 'appConfigInfo.Authorization_Info',
								data: {}
							})
							updateHasMsg(false);
							that.$store.commit(
								'ChangeAndSetStateData', {
									Name1: 'systemConfig.msgConfig.msgNum',
									data: 0
								})

							uni.redirectTo({
								url: "/pages/mine/OnlyIdentity" + "?backBtn=1",
								success() {
									that.showMLoading = false;
								}
							});
						}

					} else {

						that.loadingText = "";
						that.showMLoading = false;
						that.isLoading = false;
					}

				}, function(err) {
					that.isLoading = false;
					console.log(JSON.stringify(err))
				}, that.Request.IPAgreement() + that.Request.serverIP() + '/Frame/SqlData', 1)
			},
		}
	}
</script>

<style lang="scss">
	.content {
		align-items: center;
		background-color: #fff !important;

		.uni-select__input-box {

			.uni-icons {
				color: #989898 !important;
			}
		}

		.LogoBox {
			height: 26vh;
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: flex-end;

			.Logo {
				display: flex;
				// justify-content: center;
				align-items: center;

				.img {
					// width: 100%;
					border-radius: 12rpx;
					overflow: hidden !important;
					// filter: drop-shadow(4px 8px 2px rgba(112, 112, 112, .2));
					filter: drop-shadow(4px 5px 2px rgba(112, 112, 112, .2));
				}

				.text {
					margin-left: 20rpx;
					font-size: 64rpx;
					color: #333;
					font-weight: 600;
					text-shadow: 2px 2px 3px #fff, 4px 4px 5px #999;
					letter-spacing: 2px;
				}
			}
		}

		.FormBox {
			min-height: 200px;
			width: 100%;
			// padding: 20px;

			// 表单内容
			.formDataBox {
				width: 88%;
				margin: 0 auto;

				// 输入框上层类名
				.uni-easyinput__content {
					background-color: transparent !important;
					border: none !important;
					// border-bottom: 1px solid #c6c6c6 !important;
				}

				// 下拉框
				.uni-select {
					background-color: transparent !important;
					border: none !important;
					padding: 0 28rpx !important;

					.uni-select__selector {
						padding: 8px !important;

						.uni-select__selector-item {
							height: 50px !important;
							line-height: 50px !important;
						}
					}

					.uni-select__input-placeholder {
						color: #999;
					}
				}

				// 给底部增加一条线
				.uni-easyinput__content::after,
				.uni-select::after {
					position: absolute;
					box-sizing: border-box;
					content: ' ';
					pointer-events: none;
					right: 16px;
					bottom: 0;
					left: 16px;
					border-bottom: 1px solid #d8d8d8;
					-webkit-transform: scaleY(0.5);
					transform: scaleY(0.5);
				}

				.uni-easyinput__content-input {
					padding-left: 30rpx !important;
				}

				// 
				.u-checkbox__icon-wrap {
					background-color: transparent !important;
				}
			}
		}

		.BtnBox {
			width: 100%;

			.LoginBtn {
				background-color: #51d0d0;
				display: flex;
				align-items: center;
				justify-content: center;
				width: 90%;
				margin: 0 auto;
				// color: #fff;

				.Text {
					margin-left: 10px;
				}
			}

			// 按钮的边框线在这里去除
			uni-button:after {
				border: none !important;
			}
		}

		// 复选框样式 start
		.uni-checkbox-input {
			border: 2px solid #d1d1d1 !important;
		}

		.uni-checkbox-input-checked {
			background: #51d0d0;
			color: #fff !important;
			border-color: #51d0d0 !important;
		}

		// 复选框样式 End

		// 底部文字
		.BottomText {
			position: absolute;
			bottom: 20px;
			left: 0;
			width: 100%;
			text-align: center;
			color: #a6a6a6;
			font-size: 12px;
		}
	}
</style>